home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-comments-reply.php < prev    next >
Encoding:
PHP Script  |  2004-04-28  |  3.9 KB  |  96 lines

  1. <?php 
  2. /* Don't remove these lines. */
  3. $single = 1;
  4. $id = (int) $_GET['post_'];
  5. require ('wp-blog-header.php');
  6. ?>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10.     <title><?php echo get_settings('blogname'); ?> » Comments on "<?php the_title() ?>"</title>
  11.  
  12.     <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
  13.     <style type="text/css" media="screen">
  14.         @import url( wp-layout.css );
  15.         body { margin: 3px; padding: 10px}
  16.     </style>
  17.  
  18. </head>
  19. <body id="commentspopup">
  20.  
  21. <h1 id="header"><a href="<?php echo get_settings('home'); ?>" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>
  22.  
  23. <h2 id="comments">Replying to Comment:</h2>
  24. <?php
  25.     if (($withcomments) or ($single)) {
  26.  
  27.         if (!empty($post->post_password)) { // if there's a password
  28.             if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) {  // and it doesn't match the cookie
  29.                 echo("<p>Enter your password to view comments.<p>");
  30.                 return;
  31.             }
  32.         }
  33.  
  34.          $comment_author = (isset($_COOKIE['comment_author_'.$cookiehash])) ? trim($_COOKIE['comment_author_'.$cookiehash]) : '';
  35.         $comment_author_email = (isset($_COOKIE['comment_author_email_'.$cookiehash])) ? trim($_COOKIE['comment_author_email_'.$cookiehash]) : '';
  36.          $comment_author_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : '';
  37.         $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = '$id' AND comment_approved = '1' AND comment_ID = '$comment_reply_ID' ORDER BY comment_date");
  38. ?>
  39.  
  40. <!-- You can start editing here. -->
  41.  
  42.  
  43. <?php if ($comments) { ?>
  44. <ol id="commentlist">
  45. <?php foreach ($comments as $comment) { ?>
  46.     <li id="comment-<?php comment_ID() ?>">
  47.     <?php comment_text() ?>
  48.     <p><cite><?php comment_type(); ?> by <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link('Edit This', ' |'); ?></p>
  49.     </li>
  50.  
  51. <?php } // end for each comment ?>
  52. </ol>
  53. <?php } else { // this is displayed if there are no comments so far ?>
  54.     <p>No comments yet.</p>
  55. <?php } ?>
  56. <h2 id="postcomment">Leave a Comment:</h2>
  57. <?php if ('open' == $post->comment_status) { ?>
  58. <p>Line and paragraph breaks automatic, email address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
  59.  
  60. <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  61.     <p>
  62.       <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
  63.        <label for="author">Name</label>
  64.     <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  65.     <input type="hidden" name="redirect_to" value="<?php echo get_settings('siteurl')."/index.php?p=".$id ?>" />
  66.     <input type="hidden" name="comment_reply_ID" value="<?php echo $comment_reply_ID; ?>" />
  67.     </p>
  68.  
  69.     <p>
  70.       <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" />
  71.        <label for="email">Email</label>
  72.     </p>
  73.  
  74.     <p>
  75.       <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />
  76.        <label for="url"><acronym title="Uniform Resource Identifier">URI</acronym></label>
  77.     </p>
  78.  
  79.     <p>
  80.       <label for="comment">Your Comment</label>
  81.     <br />
  82.       <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>
  83.     </p>
  84.  
  85.     <p>
  86.       <input name="submit" type="submit" tabindex="5" value="Say it!" />
  87.     </p>
  88. </form>
  89. <?php } else { // comments are closed ?>
  90. <p>Sorry, the comment form is closed at this time.</p>
  91. <?php } ?>
  92.  
  93. <?php // if you delete this the sky will fall on your head
  94. }
  95. ?>
  96.